#include "IdentifiersTable.h"
bool IdentifiersTable::IdentifierExisted(std::string newIdentifierName)
{
    for(int i=0;i<m_intTypeIdentifiers.size();++i)
    {
        if(newIdentifierName==m_intTypeIdentifiers[i].GetName())
        {
            return true;
        }
    }
    for(int i=0;i<m_realTypeIdentifiers.size();++i)
    {
        if(newIdentifierName==m_realTypeIdentifiers[i].GetName())
        {
            return true;
        }
    }
    for(int i=0;i<m_stringTypeIdentifiers.size();++i)
    {
        if(newIdentifierName==m_stringTypeIdentifiers[i].GetName())
        {
            return true;
        }
    }
    return false;
}
IdentifiersTable::IdentifiersTable()
{
}
IdentifiersTable::~IdentifiersTable()
{
}
bool IdentifiersTable::AddIdentifier(std::string name,int value)
{
    if(IdentifierExisted(name))
    {
        return false;
    }
    Identifier<int>newIdentifier(name,value);
    m_intTypeIdentifiers.push_back(newIdentifier);
}
bool IdentifiersTable::AddIdentifier(std::string name,double value)
{
    if(IdentifierExisted(name))
    {
        return false;
    }
    Identifier<double>newIdentifier(name,value);
    m_realTypeIdentifiers.push_back(newIdentifier);
}
bool IdentifiersTable::AddIdentifier(std::string name,std::string value)
{
    if(IdentifierExisted(name))
    {
        return false;
    }
    Identifier<std::string>newIdentifier(name,value);
    m_stringTypeIdentifiers.push_back(newIdentifier);
}





















